package com.recipe.job;

import com.recipe.service.DishLikedService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author lzk
 * @date 2024-06-18 10:30:36
 * @description
 */
@Component
@Slf4j
public class SyncLikedJob {

    @Resource
    private DishLikedService dishLikedService;
    @XxlJob("syncLikedJobHandler")
    public void syncLikedJobHandler() throws Exception {
        XxlJobHelper.log("syncLikedJobHandler.start");
        try {
            dishLikedService.synLiked();
        } catch (Exception e) {
            XxlJobHelper.log("syncLikedJobHandler.error" + e.getMessage());
        }
    }

}
